import Vue from "vue";
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import App from "./App.vue";
import router from "./router/router";
import store from "./store";
import './assets/common.css/neat-min.css';
import './assets/common.css/all.css'
import axios from "axios"
import "./assets/iconfont/iconfont.css"
import {isLogin} from "@/api"
// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
//全局守卫
router.beforeEach((to,from,next)=>{
  if(to.path=="/login"){
    next()
  }else{
    isLogin().then(res=>{
      if(res.data.status!==304){
        //代表令牌未失效
        next()
      }else{
        next({path:"/login"})
      }
    })
  }
})

Vue.config.productionTip = false;

Vue.use(MintUI)
Vue.prototype.$http = axios

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
